In this How To we are going to build DHCP4.2.5-P1 with our GCC 4.8.2 cross-compiler. Be sure to start this build in a new terminal/tab to avoid any pollution from previous builds.
Tar Balls
Here is a list of source packages that we'll need for the build. You can either download them now or wait 'til later in the How To.
dhcp-4.2.5-P1.tar.gz
dhcp-4.2.5-P1-client_script-1.patch
Create a Workspace
I recommend creating a workspace under your /home/<your user>/ directory that is dedicated to this build. So let's fire up your terminal and run the following:
NOTE: Depending on whether you are using a cross-compiler built from my other wikis you might need to change INSTALLDIR to point to your cross-compiler.
Build DHCP
Hack Alert!!
$ echo ac_cv_file__dev_random=yes > config.cache
$ CFLAGS="-D_PATH_DHCLIENT_SCRIPT='\"/sbin/dhclient-script\"' \
-D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \
-D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'"
$ ./configure --prefix=/home/<your user>/workbench/dhcp/final --sysconfdir=/home/<your user>/workbench/dhcp/final/etc/dhcp --localstatedir=/var --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases --with-cli-lease-file=/var/lib/dhclient/dhclient.leases --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases --host=$TARGETMACH --cache-file=config.cache
We need to do some fixes, ../bind/Makefile:
change:
(cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no > ${binddir}/configure.log);
to:
(cd ${bindsrcdir} && BUILD_CC=gcc ./configure --host=i686-pc-linux-gnu --with-randomdev=/dev/random --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no > ${binddir}/configure.log);
More fixes../bind:
tar -pxzf bind.tar.gz
open ../bind-9.8.4-P2/lib/export/dns/Makefile.in and change:
gen: ${srcdir}/gen.c
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
to:
gen: ${srcdir}/gen.c
${BUILD_CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS}
$ make
$ make install
*I* had to do the above hack for this to cross-compile on my machine. You might not have to. Try the build without doing the above hack and go from there.
Output
cd into the final directory and output its contents:
$ cd ../final/
$ ls
You should have the following directories:
bin
etc
include
lib
sbin
share
Make sure the binaries are for ARM:
$ cd bin/
$ file omshell
bash: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
If you see something similar to above you're good to go ;-)
Lastly, move the contents of these directories, or the directories themselves if they do not already exist, to your custom Linux file system or dev board.
Usage
!!! NOTE: You MUST create the /sbin/dhclient-script for this to work properly. Use the script in ../dhcp/src/dhcp-4.2.5-P1/client/scripts/linux and re-name it to dhclient-script. In this script I had to comment out chown & chmod bits because BusyBox does not support "--reference" :/ !!!
This assumes you've setup wpa_supplicant.conf
$ wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf & dhclient -v <interface, i.e. wlan0 or eth0>
How To Build ISC DHCP for ARM
Intro
In this How To we are going to build DHCP 4.2.5-P1 with our GCC 4.8.2 cross-compiler. Be sure to start this build in a new terminal/tab to avoid any pollution from previous builds.
Tar Balls
Here is a list of source packages that we'll need for the build. You can either download them now or wait 'til later in the How To.
Create a Workspace
I recommend creating a workspace under your /home/<your user>/ directory that is dedicated to this build. So let's fire up your terminal and run the following:
Gather the Sources
Now that we have a workspace created and we are currently in the src directory we can begin bringing down the sources and extracting them.
dhcp
patch
Build Environment
To make things a little smoother let's setup some environment variables:
$ export INSTALLDIR=~/workbench/gcc-4.8.2/arm $ export PATH=$INSTALLDIR/bin:$PATH $ export TARGETMACH=arm-none-linux-gnueabi $ export BUILDMACH=i686-pc-linux-gnu $ export CROSS=arm-none-linux-gnueabi $ export CC=${CROSS}-gcc $ export LD=${CROSS}-ld $ export AS=${CROSS}-asNOTE: Depending on whether you are using a cross-compiler built from my other wikis you might need to change INSTALLDIR to point to your cross-compiler.Build DHCP
Hack Alert!!
$ echo ac_cv_file__dev_random=yes > config.cache $ CFLAGS="-D_PATH_DHCLIENT_SCRIPT='\"/sbin/dhclient-script\"' \ -D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"' \ -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" $ ./configure --prefix=/home/<your user>/workbench/dhcp/final --sysconfdir=/home/<your user>/workbench/dhcp/final/etc/dhcp --localstatedir=/var --with-srv-lease-file=/var/lib/dhcpd/dhcpd.leases --with-srv6-lease-file=/var/lib/dhcpd/dhcpd6.leases --with-cli-lease-file=/var/lib/dhclient/dhclient.leases --with-cli6-lease-file=/var/lib/dhclient/dhclient6.leases --host=$TARGETMACH --cache-file=config.cache We need to do some fixes, ../bind/Makefile: change: (cd ${bindsrcdir} && ./configure --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no > ${binddir}/configure.log); to: (cd ${bindsrcdir} && BUILD_CC=gcc ./configure --host=i686-pc-linux-gnu --with-randomdev=/dev/random --disable-kqueue --disable-epoll --disable-devpoll --without-openssl --without-libxml2 --enable-exportlib --enable-threads=no --with-export-includedir=${binddir}/include --with-export-libdir=${binddir}/lib --with-gssapi=no > ${binddir}/configure.log); More fixes../bind: tar -pxzf bind.tar.gz open ../bind-9.8.4-P2/lib/export/dns/Makefile.in and change: gen: ${srcdir}/gen.c ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS} to: gen: ${srcdir}/gen.c ${BUILD_CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ${srcdir}/gen.c ${LIBS} $ make $ make install*I* had to do the above hack for this to cross-compile on my machine. You might not have to. Try the build without doing the above hack and go from there.Output
cd into the final directory and output its contents:
You should have the following directories:
Make sure the binaries are for ARM:
If you see something similar to above you're good to go ;-)
Lastly, move the contents of these directories, or the directories themselves if they do not already exist, to your custom Linux file system or dev board.
Usage
!!! NOTE: You MUST create the /sbin/dhclient-script for this to work properly. Use the script in ../dhcp/src/dhcp-4.2.5-P1/client/scripts/linux and re-name it to dhclient-script. In this script I had to comment out chown & chmod bits because BusyBox does not support "--reference" :/ !!!
This assumes you've setup wpa_supplicant.conf